package me.spring.cloud.common.components.mds.strategy;

import me.spring.cloud.common.components.mds.util.DataSourceUtil;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;

/**
 * 该抽象类必须由子类实现其抽象方法，用于负责动态数据源信息获取
 * <p>
 */
public abstract class DataSourceGetStrategy {

  public abstract DataSource getDataSource(String keyDataSource);

  @Bean(name = DataSourceUtil.DATASOURCEGETSTRATEGY)
  public DataSourceGetStrategy getDataSourceReadStrategy() {
    return this;
  }
}